<cfcomponent>
	<cffunction name="readlayoutmapping" access="public" returntype="query" hint="reads the layoutmapping.xml file to determine if a specific layout needs to load for the page, component, or action called">
        <cfargument name="lname" default="" required="yes" hint="component,page,action being called">
        
        <cffile action="read" file="#request.basepath#themes/#request.site_theme#/layoutmap.xml" variable="readxml">
        <cfset mapxml = XmlParse(readxml)>	
		<cf_xmlq name = "qmapping" xpath = "/layouts/layout" xml = "#mapxml#">
        <cfquery name="qlayout" dbtype="query" maxrows="1">
        SELECT * FROM qmapping WHERE name = '#lname#'
        </cfquery>        
		<cfreturn qlayout>
	</cffunction>
	<cffunction name="readadminlayoutmapping" access="public" returntype="query" hint="reads the layoutmapping.xml file to determine if a specific layout needs to load for the page, component, or action called">
        <cfargument name="lname" default="" required="yes" hint="component,page,action being called">
        
        <cffile action="read" file="#request.adminpath#themes/#request.site_theme#/layoutmap.xml" variable="readxml">
        <cfset mapxml = XmlParse(readxml)>	
		<cf_xmlq name = "qmapping" xpath = "/layouts/layout" xml = "#mapxml#">
        <cfquery name="qlayout" dbtype="query" maxrows="1">
        SELECT * FROM qmapping WHERE name = '#lname#'
        </cfquery>        
		<cfreturn qlayout>
	</cffunction>    
</cfcomponent>